import urllib.request
import urllib.parse

url = "http://www.iqianyue.com/mypost/"
postdata = urllib.parse.urlencode({
	"name":"ceo@leo.com",
	"pass":"aa123456"
	}).encode("utf-8")
req = urllib.request.Request(url,postdata)
req.add_header('User-Agent','Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36')
data = urllib.request.urlopen(req).read()
file = open("C:/Users/will.mao/Desktop/爬虫demo/TestPostForm.html","wb")
file.write(data)
file.close()